<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <a href="#/news">新闻</a>
    <a href="#/home">主页</a>
    <button id="btn">history模式点击跳转</button>
</body>

</html>
<!-- <script src="./src/utils/sp.js"></script> -->
<!-- <script src="./src/utils/bus.js"> </script> -->
<script>
    //  window.onhashchange = function(){
    //      //location.hash 获取浏览器#好后面变更的内容
    //      console.log(location.hash)
    //  }

    btn.onclick = function () {
        history.pushState({ name: "程潇" }, null, "/news")
    }

    window.onpopstate =function(e){
        console.log(e)
    }
</script>